package com.wakala.employment.adapter.entity;

import android.os.Parcel;
import android.os.Parcelable;

import com.wakala.employment.adapter.bean.JobCategory;
import com.wakala.employment.adapter.bean.SystemCity;
import com.wakala.employment.adapter.bean.UserAddress;
import com.wakala.employment.http.bean.UserJobRecordVo;

import java.util.List;

/**
 * 招聘岗位信息
 */

public class JobInfoVo implements Parcelable {

    private Long id;

    /**
     * 职位业务ID
     */
    private String jobId;

    /**
     * 用户ID
     */
    private Long uid;

    /**
     * 用户对象
     */
    private User user;


    /**
     * 标题
     */
    private String title;

    /**
     * 内容
     */
    private String content;

    /**
     * 工作城市
     */
    private Integer jobCity;
    /**
     * 工作城市信息对象
     */
    private SystemCity jobSystemCity;

    /**
     * 工作城市名称
     */
    private String jobCityName;

    /**
     * 性别要求
     * 0:女 1：男  2：男女不限
     */
    private Integer sex;

    private String sexName;

    /**
     * 年龄要求
     */
    private Integer age;

    private String ageName;

    /**
     * 学历/文化程序要求
     */
    private Integer edu;

    private String eduName;
    /**
     * 1=固定薪水 2=面议
     */
    //@ApiModelProperty(value="薪水方式")
    private Integer salaryMode;

    /**
     * 薪水单位 1：日新 2：月薪 3：年薪 0:面议
     */
    //@ApiModelProperty(value="薪水单位")
    private Integer salaryUnit;

    //@ApiModelProperty(value="薪水区间-起")
    private Integer salaryStart;

    //@ApiModelProperty(value="薪水区间-止")
    private Integer salaryEnd;
    /**
     * 薪水名称
     */
    private String salaryName;

    /**
     * 结算方式，支持多选
     * 0=月结 1=日结 2=周结
     */
    private String settlementMode;

    private String settlementModeName;
    /**
     * 招工人数
     */
    private Integer personNum;
    private String personNumName;

    //@ApiModelProperty(value="职位标签")
    private String jobTags;
    private List<String> jobTagsList;

    //@ApiModelProperty(value="福利标签")
    private String welfareTags;
    private List<String> welfareTagsList;
    private String keywords;
    private List<String> keywordsList;


    /**
     * 工作地址
     */
    //@ApiModelProperty(value="工作地址")
    private Long jobAddress;

    // @ApiModelProperty(value="工作联系电话")
    private String linkPhone;
    /**
     * 联系人
     */
    private String linkMan;
    /**
     * 工作地址对象
     */
    private UserAddress jobUserAddress;


    /**
     * 图片
     */
    //@ApiModelProperty(value="图片")
    private String imgs;

    /**
     * 地址经度
     */
    //@ApiModelProperty(value="地址经度")
    private String jobLng;

    /**
     * 地址纬度
     */
    //@ApiModelProperty(value="地址纬度")
    private String jobLat;

    /**
     * 招工工种
     */
    //@ApiModelProperty(value="招工工种")
    private String jobCategoryId;

    /**
     * 工种名称
     */
    private String jobCategoryName;

    /**
     * 招工工种对象
     */
    //@ApiModelProperty(value="招工工种")
    private JobCategory jobCategory;

    /**
     * 发布时间
     */
    //@ApiModelProperty(value="发布时间")
    private String publishTime;

    //@ApiModelProperty(value="状态")
    private Integer status;

    /**
     * 状态名称
     */
    private String statusName;

    /**
     * 是否急招
     */
    private Boolean isExigence;

    /**
     * 是否推荐
     */
    private Boolean isRecommend;
    /**
     * 是否已删除
     */
    private Boolean isDel;

    private UserJobRecordVo userJobRecord;

    public JobInfoVo() {
    }


    protected JobInfoVo(Parcel in) {
        if (in.readByte() == 0) {
            id = null;
        } else {
            id = in.readLong();
        }
        jobId = in.readString();
        if (in.readByte() == 0) {
            uid = null;
        } else {
            uid = in.readLong();
        }
        title = in.readString();
        content = in.readString();
        if (in.readByte() == 0) {
            jobCity = null;
        } else {
            jobCity = in.readInt();
        }
        jobCityName = in.readString();
        if (in.readByte() == 0) {
            sex = null;
        } else {
            sex = in.readInt();
        }
        sexName = in.readString();
        if (in.readByte() == 0) {
            age = null;
        } else {
            age = in.readInt();
        }
        ageName = in.readString();
        if (in.readByte() == 0) {
            edu = null;
        } else {
            edu = in.readInt();
        }
        eduName = in.readString();
        if (in.readByte() == 0) {
            salaryMode = null;
        } else {
            salaryMode = in.readInt();
        }
        if (in.readByte() == 0) {
            salaryUnit = null;
        } else {
            salaryUnit = in.readInt();
        }
        if (in.readByte() == 0) {
            salaryStart = null;
        } else {
            salaryStart = in.readInt();
        }
        if (in.readByte() == 0) {
            salaryEnd = null;
        } else {
            salaryEnd = in.readInt();
        }
        salaryName = in.readString();
        settlementMode = in.readString();
        settlementModeName = in.readString();
        if (in.readByte() == 0) {
            personNum = null;
        } else {
            personNum = in.readInt();
        }
        personNumName = in.readString();
        jobTags = in.readString();
        jobTagsList = in.createStringArrayList();
        welfareTags = in.readString();
        welfareTagsList = in.createStringArrayList();
        keywords = in.readString();
        keywordsList = in.createStringArrayList();
        if (in.readByte() == 0) {
            jobAddress = null;
        } else {
            jobAddress = in.readLong();
        }
        linkPhone = in.readString();
        linkMan = in.readString();
        jobUserAddress = in.readParcelable(UserAddress.class.getClassLoader());
        imgs = in.readString();
        jobLng = in.readString();
        jobLat = in.readString();
        jobCategoryId = in.readString();
        jobCategoryName = in.readString();
        publishTime = in.readString();
        if (in.readByte() == 0) {
            status = null;
        } else {
            status = in.readInt();
        }
        statusName = in.readString();
        byte tmpIsExigence = in.readByte();
        isExigence = tmpIsExigence == 0 ? null : tmpIsExigence == 1;
        byte tmpIsRecommend = in.readByte();
        isRecommend = tmpIsRecommend == 0 ? null : tmpIsRecommend == 1;
        byte tmpIsDel = in.readByte();
        isDel = tmpIsDel == 0 ? null : tmpIsDel == 1;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        if (id == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(id);
        }
        dest.writeString(jobId);
        if (uid == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(uid);
        }
        dest.writeString(title);
        dest.writeString(content);
        if (jobCity == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(jobCity);
        }
        dest.writeString(jobCityName);
        if (sex == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(sex);
        }
        dest.writeString(sexName);
        if (age == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(age);
        }
        dest.writeString(ageName);
        if (edu == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(edu);
        }
        dest.writeString(eduName);
        if (salaryMode == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(salaryMode);
        }
        if (salaryUnit == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(salaryUnit);
        }
        if (salaryStart == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(salaryStart);
        }
        if (salaryEnd == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(salaryEnd);
        }
        dest.writeString(salaryName);
        dest.writeString(settlementMode);
        dest.writeString(settlementModeName);
        if (personNum == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(personNum);
        }
        dest.writeString(personNumName);
        dest.writeString(jobTags);
        dest.writeStringList(jobTagsList);
        dest.writeString(welfareTags);
        dest.writeStringList(welfareTagsList);
        dest.writeString(keywords);
        dest.writeStringList(keywordsList);
        if (jobAddress == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeLong(jobAddress);
        }
        dest.writeString(linkPhone);
        dest.writeString(linkMan);
        dest.writeParcelable(jobUserAddress, flags);
        dest.writeString(imgs);
        dest.writeString(jobLng);
        dest.writeString(jobLat);
        dest.writeString(jobCategoryId);
        dest.writeString(jobCategoryName);
        dest.writeString(publishTime);
        if (status == null) {
            dest.writeByte((byte) 0);
        } else {
            dest.writeByte((byte) 1);
            dest.writeInt(status);
        }
        dest.writeString(statusName);
        dest.writeByte((byte) (isExigence == null ? 0 : isExigence ? 1 : 2));
        dest.writeByte((byte) (isDel == null ? 0 : isDel ? 1 : 2));
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<JobInfoVo> CREATOR = new Creator<JobInfoVo>() {
        @Override
        public JobInfoVo createFromParcel(Parcel in) {
            return new JobInfoVo(in);
        }

        @Override
        public JobInfoVo[] newArray(int size) {
            return new JobInfoVo[size];
        }
    };

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    public Long getUid() {
        return uid;
    }

    public void setUid(Long uid) {
        this.uid = uid;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public Integer getJobCity() {
        return jobCity;
    }

    public void setJobCity(Integer jobCity) {
        this.jobCity = jobCity;
    }

    public SystemCity getJobSystemCity() {
        return jobSystemCity;
    }

    public void setJobSystemCity(SystemCity jobSystemCity) {
        this.jobSystemCity = jobSystemCity;
    }

    public String getJobCityName() {
        return jobCityName;
    }

    public void setJobCityName(String jobCityName) {
        this.jobCityName = jobCityName;
    }

    public Integer getSex() {
        return sex;
    }

    public void setSex(Integer sex) {
        this.sex = sex;
    }

    public String getSexName() {
        return sexName;
    }

    public void setSexName(String sexName) {
        this.sexName = sexName;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public String getAgeName() {
        return ageName;
    }

    public void setAgeName(String ageName) {
        this.ageName = ageName;
    }

    public Integer getEdu() {
        return edu;
    }

    public void setEdu(Integer edu) {
        this.edu = edu;
    }

    public String getEduName() {
        return eduName;
    }

    public void setEduName(String eduName) {
        this.eduName = eduName;
    }

    public Integer getSalaryMode() {
        return salaryMode;
    }

    public void setSalaryMode(Integer salaryMode) {
        this.salaryMode = salaryMode;
    }

    public Integer getSalaryUnit() {
        return salaryUnit;
    }

    public void setSalaryUnit(Integer salaryUnit) {
        this.salaryUnit = salaryUnit;
    }

    public Integer getSalaryStart() {
        return salaryStart;
    }

    public void setSalaryStart(Integer salaryStart) {
        this.salaryStart = salaryStart;
    }

    public Integer getSalaryEnd() {
        return salaryEnd;
    }

    public void setSalaryEnd(Integer salaryEnd) {
        this.salaryEnd = salaryEnd;
    }

    public String getSalaryName() {
        return salaryName;
    }

    public void setSalaryName(String salaryName) {
        this.salaryName = salaryName;
    }

    public String getSettlementMode() {
        return settlementMode;
    }

    public void setSettlementMode(String settlementMode) {
        this.settlementMode = settlementMode;
    }

    public String getSettlementModeName() {
        return settlementModeName;
    }

    public void setSettlementModeName(String settlementModeName) {
        this.settlementModeName = settlementModeName;
    }

    public Integer getPersonNum() {
        return personNum;
    }

    public void setPersonNum(Integer personNum) {
        this.personNum = personNum;
    }

    public String getPersonNumName() {
        return personNumName;
    }

    public void setPersonNumName(String personNumName) {
        this.personNumName = personNumName;
    }

    public String getJobTags() {
        return jobTags;
    }

    public void setJobTags(String jobTags) {
        this.jobTags = jobTags;
    }

    public List<String> getJobTagsList() {
        return jobTagsList;
    }

    public void setJobTagsList(List<String> jobTagsList) {
        this.jobTagsList = jobTagsList;
    }

    public String getWelfareTags() {
        return welfareTags;
    }

    public void setWelfareTags(String welfareTags) {
        this.welfareTags = welfareTags;
    }

    public List<String> getWelfareTagsList() {
        return welfareTagsList;
    }

    public void setWelfareTagsList(List<String> welfareTagsList) {
        this.welfareTagsList = welfareTagsList;
    }

    public String getKeywords() {
        return keywords;
    }

    public void setKeywords(String keywords) {
        this.keywords = keywords;
    }

    public List<String> getKeywordsList() {
        return keywordsList;
    }

    public void setKeywordsList(List<String> keywordsList) {
        this.keywordsList = keywordsList;
    }

    public Long getJobAddress() {
        return jobAddress;
    }

    public void setJobAddress(Long jobAddress) {
        this.jobAddress = jobAddress;
    }

    public String getLinkPhone() {
        return linkPhone;
    }

    public void setLinkPhone(String linkPhone) {
        this.linkPhone = linkPhone;
    }

    public String getLinkMan() {
        return linkMan;
    }

    public void setLinkMan(String linkMan) {
        this.linkMan = linkMan;
    }

    public UserAddress getJobUserAddress() {
        return jobUserAddress;
    }

    public void setJobUserAddress(UserAddress jobUserAddress) {
        this.jobUserAddress = jobUserAddress;
    }

    public String getImgs() {
        return imgs;
    }

    public void setImgs(String imgs) {
        this.imgs = imgs;
    }

    public String getJobLng() {
        return jobLng;
    }

    public void setJobLng(String jobLng) {
        this.jobLng = jobLng;
    }

    public String getJobLat() {
        return jobLat;
    }

    public void setJobLat(String jobLat) {
        this.jobLat = jobLat;
    }

    public String getJobCategoryId() {
        return jobCategoryId;
    }

    public void setJobCategoryId(String jobCategoryId) {
        this.jobCategoryId = jobCategoryId;
    }

    public String getJobCategoryName() {
        return jobCategoryName;
    }

    public void setJobCategoryName(String jobCategoryName) {
        this.jobCategoryName = jobCategoryName;
    }

    public JobCategory getJobCategory() {
        return jobCategory;
    }

    public void setJobCategory(JobCategory jobCategory) {
        this.jobCategory = jobCategory;
    }

    public String getPublishTime() {
        return publishTime;
    }

    public void setPublishTime(String publishTime) {
        this.publishTime = publishTime;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getStatusName() {
        return statusName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public Boolean getExigence() {
        return isExigence;
    }

    public void setExigence(Boolean exigence) {
        isExigence = exigence;
    }

    public Boolean getDel() {
        return isDel;
    }

    public void setDel(Boolean del) {
        isDel = del;
    }

    public UserJobRecordVo getUserJobRecord() {
        return userJobRecord;
    }

    public void setUserJobRecord(UserJobRecordVo userJobRecord) {
        this.userJobRecord = userJobRecord;
    }

    public Boolean getRecommend() {
        return isRecommend;
    }

    public void setRecommend(Boolean recommend) {
        isRecommend = recommend;
    }
}